#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N;
	cin >> N;
	int S[N] = {0};
	for (int i = 0 ; i < N; i++) {
		int temp ;
		cin >> temp;
		S[temp - 1] = 1;
	}
	int cnt = 0;
	for (int i = 0; i < N; i++) {
		if (S[i] == 1) {
			cnt ++;
		}
	}
	cout << cnt << endl;
	return 0;
}
